package com.dy.排序.内排序;
//待排序的顺序表
public class SqlList {
    public RecordNode[] r;
    public int curlen;

    public SqlList(int maxSize) {
        this.r = new RecordNode[maxSize];
        this.curlen = 0;
    }

    public void insert(int i ,RecordNode x) throws Exception{
        if(curlen==r.length){
            throw new Exception("顺序表已满");

        }
        if(i<0||i>curlen){
            throw new Exception("插入位置不合理");
        }
        for(int j =curlen;j>i;j--){
            r[j] = r[j-1];
        }
        r[i] = x;
        curlen--;
    }

}
